package com.qipay.sp.excutor.qfpay.token;

import com.qipay.sp.excutor.qfpay.QfGetTokenNativeExcutor;

/**
 * Created by 杨荔楠_pc on 2017/12/1.
 */
public class QfpayTokenBuilder {

    private static QfpayToken token;

    public static String getToken( String mchId ,String key){
        if(token == null || token.isExpire()){
            token = QfGetTokenNativeExcutor.getToken(mchId,key);
        }

        if(token == null){
            throw new RuntimeException("琦付登陆失败");
        }
        return token.getToken();
    }
}
